<?php


namespace app\api\model;


class Category extends BaseModel
{
    protected $hidden = [
        'delete_time',
        'update_time',
        'topic_img_id'
    ];
    public function topicImg(){
        return $this->hasOne(Image::class,'id','topic_img_id');
    }
    public static function getCategories(){
        return self::with(['topicImg'])->select();
    }
}